<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>居中方式</title>
	<style>
		div{
			width: 400px;
			height: 50px;
			background: lime;
			text-align: center;
			margin: auto auto;
		}
        p{
        	width: 400px;
        	height: 400px;
        	background: yellow;
        	text-align: center;
        	margin: 8px auto;
        }

        img{
        	width: 200px;
        }

	</style>
</head>
<body>
    <div>文字</div>
    <p><img src="images/01.jpg" alt=""></p>
</body>
</html>